package net.huashitong.user.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.user.dao.SuperviseUserDao;
import net.huashitong.user.entity.SuperviseUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SuperviseUserService extends StringPKService<SuperviseUser> {
    @Autowired
    private SuperviseUserDao dao;
    @Autowired
    private SysTableService tableService;
    @Override
    protected BaseDao<SuperviseUser,String> getDao() {
        return dao;
    }
    @Override
    protected void beforeSave(SuperviseUser obj){
        obj.setSysId(tableService.updateMaxSysId("t_bnp_supervise_user", null));
    }
    public List<SuperviseUser> querySuperviseUserListByProjectId(String projectId){
        return dao.querySuperviseUserListByProjectId(projectId);
    }
    public List<SuperviseUser> querySuperviseUserListByIsLeader(String isLeader){
        return dao.querySuperviseUserListByIsLeader(isLeader);
    }
    public List<SuperviseUser> querySuperviseUserListByPhone(String phone){
        return dao.querySuperviseUserListByPhone(phone);
    }
}
